var wechatui = {
  searchBar: function ($scope) {
    $scope.isblur = false;
    $scope.focusing = ''; //获得焦点时增加样式weui_search_focusing
    $scope.isSearchShow = false; //是否显示搜索框的下拉列表
    $scope.searchInput = ''; //搜索内容清空
    $scope.searchText = true; //是否显示默认状态下的搜索条样式

    $scope.searchClickEvent = function () {
      $scope.searchText = false;
      document.getElementById('searchInput').focus();
      $scope.focusing = 'weui_search_focusing';
    };

    $scope.searchFocusEvent = function () {
      $scope.focusing = 'weui_search_focusing';
    };

    $scope.searchBlurEvent = function () {
      if (!$scope.isblur) {
        document.getElementById('searchInput').focus();
        $scope.isblur = true;
      } else {
        $scope.searchText = true;
        $scope.isSearchShow = false;
        $scope.focusing = '';
        $scope.searchInput = '';
        $('#searchInput').change();
        $scope.isblur = false;
      }
    };

    $scope.searchKeyupEvent = function () {

      if ($scope.searchInput) {
        $scope.isSearchShow = true;
      } else {
        $scope.isSearchShow = false;
      }
    };

    $scope.searchCancel = function () {
    }
  }

};

